<%@ page import="java.time.LocalDate" %>
<%@ page import="java.time.temporal.ChronoUnit" %>
<%@ page import="java.io.FileInputStream" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.io.InputStreamReader" %>
<%@ page import="java.io.IOException" %>
<%@ page import="java.time.format.DateTimeFormatterBuilder" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%!
    long days = 0;
    String day = "G:\\2.txt";

    public void jspInit() {

        LocalDate today = LocalDate.now();  //获取今天日期
        LocalDate holiday = LocalDate.of(2022, 7, 11);   //获取指定日期
        day = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        days = today.until(holiday, ChronoUnit.DAYS); //两个日期之间的天数
    }

%>
<html>
<head>
    <h1>使用page指令导入日期类</h1>
    <p>今天是：<%=day%>
    </p>
    <p>离暑假还有<%=days %>天</p>
</head>
<body>

</body>
</html>
